package com.bao.interkont.mapper;

import com.bao.interkont.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * @author bao*
 * @version 1.0
 */
@Mapper
public interface UserMapper {

    @Select("select * from user")
    public List<User> getUser();

    @Insert("insert into user(img,user_name,account,password) values(#{img},#{userName},#{account},#{password})")
    public void addUser(User user);

    @Select("select * from user where account = #{account}")
    public User isAccountSame(@Param(value = "account") String account);

    @Select("select * from user where uid = #{uid}")
    User getUserByUid(@Param(value = "uid") Integer uid);
}
